clear;close all;
namePool = [80:1:110];
f = [0.8:0.01:1.1] * 1e12;

% [Ip, Im, IT, IQ, IM] = FC_RadiativePower('E:\YW\CST&Comsol-仿真文件\【B420】CST\【表面电流】\表面电流结果1\', namePool, f);
[Ip, Im, IT, IQ, IM] = FC_RadiativePower('E:\YW\CST&Comsol-仿真文件\【B420】CST\【表面电流】\上层表面电流\', namePool, f);

NM = max(IT.IT);

YW_Plot_Fast({f / (1e12), Ip.Ip/NM, f / (1e12), Im.Im/NM, f / (1e12), IT.IT/NM, ...
    f / (1e12), IQ.IQ/NM, f / (1e12), IM.IM/NM}, {'-o', '-d', '-v', '-s', '-^b'}, ["\itP", '\itM', '\itT', '\itQ_e', '\itQ_m'], ["Frequency (THz)", 'Sacttering power (a.u.)']);
% set(gca, 'yscale', 'log');

YW_Plot_Fast({f / (1e12), IT.ITx/NM, f / (1e12), IT.ITy/NM, f / (1e12), IT.ITz/NM,...
    f / (1e12), IT.IT/NM}, {'-o', '-d', '-v', '-s'}, ["\itTx", '\itTy', '\itTz', '\itT'],...
    ["Frequency (THz)", 'Radiation   power (a.u.)']);
% set(gca, 'yscale', 'log');
% saveRadiativePower = [f' Ip' Im' IT' IQ' IM'];
% saveRadiativePower = [f' Ip.Ip'/NM Ip.Ipx'/NM Ip.Ipy'/NM Ip.Ipz'/NM Im.Im'/NM IT.IT'/NM IQ.IQ'/NM IM.IM'/NM IT.ITx'/NM IT.ITy'/NM IT.ITz'/NM];
% SaveFile(saveRadiativePower,'Radative Power');
% YW_Plot_Fast({f / (1e12), Ip.Ip+Im.Im+IT.IT+IQ.IQ+IM.IM});
